	<?php
	//var_dump($_GET);
	function set_activelink($url = null, $name_controller=null,$type_controller=null){
		
		if($type_controller == null){
			if((isset($_GET['url']) && $_GET['url'] == $name_controller)){
				echo ' li_active';
			}
			else{
				echo '';
			}
			return true;
		}
		//index
		else{
			$search = $name_controller;
			$replace ='';
			$subject = $url;
			$count_url = 0;
			$check_link = str_replace ($search , $replace , $subject, $count_url );
			if($count_url > 0){
				echo ' li_active';
			}
			else{
				echo '';
			}
		}
	}
	//if((isset($_GET['url']) && $_GET['url'] =='categories') || (isset($_GET['url']) && $_GET['url'] =='categories/index')){ echo ' li_active';}
?>
	<div id="sidebar"><!--#sidebar-->
				<script>
					$(function() {
					$( "#accordion" ).accordion({
						autoHeight: false,
						navigation: true
					});
					});
				</script>
				<div id="accordion">
					<h3><a href="#">Quản lý tin tức</a></h3>
					<div class="box_sidebar">
						<ul class="ul_box_sidebar">
							<li class="li_box_sidebar<?php set_activelink($_GET['url'],'news','index');?>"><?php echo $this->Html->link(__('Danh sách tin tức', true), array('controller' => 'news', 'action' => 'index')); ?> </li>
							<li class="li_box_sidebar<?php set_activelink($_GET['url'],'news/add',null);?>"><?php echo $this->Html->link(__('Tạo mới tin', true), array('controller' => 'news', 'action' => 'add')); ?></li>
						</ul>
					</div>
					<h3><a href="#"> Quản lý chuyên mục</a></h3>
					<div class="box_sidebar">
						<ul class="ul_box_sidebar">
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Danh sách chuyên mục', true), array('controller' => 'categories', 'action' => 'index')); ?> </li>
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Tạo mới chuyên mục', true), array('controller' => 'categories', 'action' => 'add')); ?> </li>
							
						</ul>
						</ul>
					</div>
					<h3><a href="#">Quản lý video</a></h3>
					<div class="box_sidebar">
						<ul class="ul_box_sidebar">
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Tìm kiếm video', true), array('controller' => 'videos', 'action' => 'find')); ?> </li>	
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Danh sách video', true), array('controller' => 'videos', 'action' => 'index')); ?> </li>
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Tạo mới video', true), array('controller' => 'videos', 'action' => 'add')); ?> </li>
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Chuyên mục video', true), array('controller' => 'catvideos', 'action' => 'index')); ?></li>
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Tạo mới chuyên mục', true), array('controller' => 'catvideos', 'action' => 'add')); ?></li>
						</ul>
					</div>
					<h3><a href="#">Quản lý người dùng</a></h3>
					<div class="box_sidebar">
						<ul class="ul_box_sidebar">
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Danh sách người dùng', true), array('controller' => 'users', 'action' => 'index')); ?> </li>	
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Thêm mới người dùng', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Nhóm người dùng', true), array('controller' => 'groups', 'action' => 'index')); ?> </li>
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Thêm mới nhóm', true), array('controller' => 'groups', 'action' => 'add')); ?> </li>
						</ul>
					</div>
					<h3><a href="#">Cấu hình hệ thống</a></h3>
					<div class="box_sidebar">
						<ul class="ul_box_sidebar">
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Danh sách người dùng', true), array('controller' => 'videos', 'action' => 'find')); ?> </li>	
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Thêm mới người dùng', true), array('controller' => 'videos', 'action' => 'index')); ?> </li>
							<li class="li_box_sidebar"><?php echo $this->Html->link(__('Nhóm người dùng', true), array('controller' => 'videos', 'action' => 'add')); ?> </li>
							
						</ul>
					</div>
				</div>


			</div><!--end #sidebar-->
			